package com.lpc.glide4;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;

public class MainActivity extends AppCompatActivity {

    private TextView tv;
    private TextView tv2;
    private ImageView iv;

    private static final String myUrl = "http://img.juimg.com/tuku/yulantu/120926/219049-12092612022378.jpg";

    private void assignViews() {
        tv = findViewById(R.id.tv);
        tv2 = findViewById(R.id.tv2);
        iv = findViewById(R.id.iv);
    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(com.lpc.glide4.R.layout.activity_main);

        assignViews();
    }

    public void click(View view) {

        Glide.with(this)
                .load(myUrl)
                .into(iv);
    }

    public void click2(View view) {

        Glide.with(this).clear(iv);
    }
}
